From 02e0e0d9bb791264722682d5dc26691e3a338803 Mon Sep 17 00:00:00 2001 From: "emellor@leeni.uk.xensource.com" Date: Mon, 10 Apr 2006 16:28:52 +0100 Subject: [PATCH] Initialise offsetopt when offset == 0. Closes bug #599. Report and diagnosis by Robert Hendrickx . Signed-off-by: Ewan Mellor --- tools/pygrub/src/fsys/ext2/ext2module.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/pygrub/src/fsys/ext2/ext2module.c b/tools/pygrub/src/fsys/ext2/ext2module.c index 63d20f2983..57f1a83eaf 100644 --- a/tools/pygrub/src/fsys/ext2/ext2module.c +++ b/tools/pygrub/src/fsys/ext2/ext2module.c @@ -228,7 +228,10 @@ ext2_fs_open (Ext2Fs *fs, PyObject *args, PyObject *kwargs) } #ifdef HAVE_EXT2FS_OPEN2 - if (offset != 0) { + if (offset == 0) { + offsetopt[0] = '\0'; + } + else { snprintf(offsetopt, 29, "offset=%d", offset); } -- 2.30.2